//
//  ActivityViewController.m
//  carcar
//
//  Created by dlios on 15/9/18.
//  Copyright (c) 2015年 DIOS. All rights reserved.
//

#import "ActivityViewController.h"
#import "BaseHeader.h"
@interface ActivityViewController ()<UIWebViewDelegate>

@end

@implementation ActivityViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.navigationController.navigationBar.hidden = YES;
//    self.navigationController.tabBarController.tabBar.hidden = YES;
    UIView *headView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,mainScreen_Width , 64)];
    [headView setBackgroundColor:[UIColor colorWithRed:0.088 green:0.331 blue:1.000 alpha:1.000]];
    [self.view addSubview:headView];
    
    UILabel *titleLab = [[UILabel alloc]initWithFrame:CGRectMake(mainScreen_Width / 2.542, mainScree_Height / 24.703, mainScreen_Width / 3.75, mainScree_Height / 22.233)];
    [headView addSubview:titleLab];
    [titleLab setText:@"活 动 详 情"];
    
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [backButton setImage:[UIImage imageNamed:@"iconfont-fanhui"] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
    [headView addSubview:backButton];
    [backButton setFrame:CGRectMake(mainScreen_Width / 22.058, mainScree_Height / 24.703, mainScreen_Width / 12.5, mainScree_Height / 22.233)];
    [backButton setTintColor:[UIColor redColor]];
    [backButton setTitleColor:[UIColor colorWithRed:0.088 green:0.331 blue:1.000 alpha:1.000] forState:UIControlStateSelected];
    

    
    UIWebView *detailWebView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 64, mainScreen_Width, mainScree_Height - 64)];
    NSURLRequest *request =  [NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://mrobot.pcauto.com.cn/xsp/s/auto/info/v4.6/activityDetailv46.xsp?tuanId=%@&areaId=1&serialId=0&modelId=0&name=&tel=&dId=a6938a778ec8f955189a3fd89bdb1a49eabfa23e",self.model.cid]]];
    NSLog(@"%@",self.model.cid);
    [detailWebView scalesPageToFit];
    [detailWebView loadRequest:request];
    [self.view addSubview:detailWebView];
    detailWebView.delegate = self;

    
 
}
- (void)backAction:(UIButton *)backBut
{
    self.navigationController.navigationBar.hidden = NO;
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
